package org.nicocube.airain.app.server.domain;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.nicocube.airain.app.client.domain.Gender;

import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class GameCharacterStorable implements Serializable {

	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long order;

	@Persistent
	private String name;

	@Persistent
	private Date birthDate;
	
	@Persistent
	private Gender gender;

	@Persistent
	private User owner;
	
	protected GameCharacterStorable() {
	}
	
	public GameCharacterStorable(String name, Gender gender, User owner) {
		this(null,name,gender,owner);
	}
	
	public GameCharacterStorable(Long order, String name, Gender gender, User owner) {
		this.order = order;
		this.name = name;
		this.gender = gender;
		this.owner = owner;
		this.birthDate = new Date();
	}

	public Long getOrder() {
		return order;
	}

	public String getName() {
		return name;
	}

	public Date getBirthDate() {
		return birthDate;
	}

	public Gender getGender() {
		return gender;
	}
	
	public User getOwner() {
		return owner;
	}
}
